class Animal(object):
    def speak(self):
        print("Animal speak")


class Dog(Animal):
    def speak(self):
        print("Dog speak")


class Cat(Animal):
    def speak(self):
        print("Cat speak")


def speak(object):
    object.speak()


animal = Animal()
kitty = Cat()
puppy = Dog()

speak(animal)  # Animal speak
speak(kitty)  # Cat speak
speak(puppy)  # Dog speak